# install shadowsocks
$wc = (new-object System.Net.WebClient)
$UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"
$wc.Headers.Add([System.Net.HttpRequestHeader]::UserAgent, $UserAgent)
$json = $wc.downloadstring('https://api.github.com/repos/shadowsocks/shadowsocks-windows/releases/latest') | ConvertFrom-Json
Write-Output ($json.assets.browser_download_url)
$shadow_dir="D:\Shadowsocks"
Write-Output $shadow_dir

$wc.DownloadFile($json.assets.browser_download_url, 'shadowsocks.zip')
Expand-Archive -Path .\shadowsocks.zip -DestinationPath $shadow_dir

# Run Shadowsocks
Invoke-Expreesion $shadow_dir\Shadowsocks.exe
